package switchviz.graphic.gauge;

import javax.media.opengl.GL;

import switchviz.graphic.GraphicUtils;
import switchviz.graphic.signal.IGaugeSignal;

public class GaugeDetailed {

	private IGaugeSignal[] _signals;
	
	public GaugeDetailed(IGaugeSignal[] signals)
	{
		_signals = signals;
	}
	
	
	public void draw(GL gl)
	{
		gl.glPushMatrix();
		
		for (int i=0; i<_signals.length; i++)
		{
			gl.glColor4f(_signals[i].getColor()[0], _signals[i].getColor()[1], _signals[i].getColor()[2], 0.5f);
			
			gl.glBegin(GL.GL_QUADS);
			
			gl.glVertex2f(-0.1f,0.03f);
			gl.glVertex2f(-0.1f,-0.03f);
			gl.glVertex2f(-0.02f,-0.03f);
			gl.glVertex2f(-0.02f,0.03f);
			
			gl.glEnd();
			
			GraphicUtils.drawString(gl, 5, GraphicUtils.ALIGN_LEFT, GraphicUtils.FONT_ROMAN, _signals[i].getName());
			
			gl.glTranslatef(0.0f, -0.1f, 0.0f);
		}
		
		gl.glPopMatrix();
	}
}
